package org.zju.moviemotion;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import java.io.File;

public class SettingsUtils {
	public static final String APP_SETTINGS = "moviemotion";
	public static final String FIRST = "first_0";
	public static final String LOVE_COLLECTION = "love_collection";

	public static void ClearConfig(Context context) {
		SharedPreferences shared = context.getSharedPreferences(APP_SETTINGS,
				Context.MODE_PRIVATE);
		shared.edit().clear().commit();
	}

	private static int appVersionCode(Context paramContext) {
		try {
			int i = paramContext.getPackageManager().getPackageInfo(
					paramContext.getPackageName(), 0).versionCode;
			return i;
		} catch (PackageManager.NameNotFoundException localNameNotFoundException) {
			throw new IllegalStateException("Unrecoverable failure",
					localNameNotFoundException);
		}
	}

	public static String getLove(Context paramContext) {
		return paramContext.getSharedPreferences(APP_SETTINGS, 0).getString(
				LOVE_COLLECTION, "");
	}

	public static void setLove(Context paramContext, String param) {
		SharedPreferences.Editor localEditor = paramContext
				.getSharedPreferences(APP_SETTINGS, 0).edit();
		localEditor.putString(LOVE_COLLECTION, param);
		localEditor.commit();
	}
}